import {Action, getModule, Module, Mutation, VuexModule} from "vuex-module-decorators";
import store from "@/store";
import {IImageSourcing} from "@/store/pojo/IImageSourcing";

@Module({
    name: 'imageSourcing',
    namespaced: true,
    dynamic: true,
    store,
})
export default class imageSourcing extends VuexModule {
    public imageSourcing: IImageSourcing = {
        src:'',
        res: new  Array<string>()

    }

    /**
     * 从src中获得数据
     */
    get src(): string{
        return this.src;
    }


    get res():Array<string>{
        return this.res;
    }

    @Mutation
    pushOne(rect:string):void{
        this.imageSourcing.res.push(rect);
    }


    @Mutation
    setSrc(src1:string):void{
        this.imageSourcing.src = src1;
    }




}

export const ImageSourcingStoreModule = getModule(imageSourcing);